{if $full_page}
<!-- $Id: users_list.htm 17053 2010-03-15 06:50:26Z sxc_shop $ -->
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}

<div class="form-div">
  <form action="javascript:searchUser()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />&nbsp; 
      <select name="user_rank" style="display: none;">
        <option value="0">{$lang.all_option}</option>
        {html_options options=$user_ranks }
      </select>
    &nbsp;&nbsp;
    <input type="text" name="pay_points_gt" size="8" style="display: none;" />&nbsp;&nbsp;
    <input type="text" name="pay_points_lt" size="10" style="display: none;" />&nbsp;店铺名 &nbsp;
    <input type="text" name="shop_name" />
    &nbsp;店员名 &nbsp;
    <input type="text" name="waiter_name" />
    <input type="submit" value="{$lang.button_search}" />
  </form>
</div>

<form method="POST" action="" name="listForm" onsubmit="return confirm_bath()">

<!-- start users list -->
<div class="list-div" id="listDiv">
{/if}
<!--用户列表部分-->
<table cellpadding="3" cellspacing="1">
  <tr>
    <th>
      <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" style="display: none;">
      <a href="javascript:listTable.sort('id');">{$lang.record_id}</a>{$sort_id}
    </th>
    <th>用户</th>
    <th>营业员</th>
    <th>商家</th>
    <th><a href="javascript:listTable.sort('money_paid');">金额</a>{$sort_money_paid}</th>
    <th><a href="javascript:listTable.sort('id');">时间</a>{$sort_id}</th>
  <tr>
  {foreach from=$sales_list item=list}
  <tr>
    <td align="center" width="16%">{$list.id}</td>
    <td align="center" width="16%">{$list.user_name}</td>
    <td align="center" width="16%">{$list.waiter_name}</td>
    <td align="center" width="16%">{$list.shop_name}</td>
    <td align="center" width="16%">{$list.money_paid}</td>
    <td align="center" width="16%">{$list.add_time_format}</td>
  </tr>
  {foreachelse}
  <tr><td class="no-records" colspan="10">{$lang.no_records}</td></tr>
  {/foreach}
  <tr>
      <td colspan="2" style="display: none;">
      <input type="hidden" name="act" value="batch_remove" />
      <input type="submit" id="btnSubmit" value="{$lang.button_remove}" disabled="true" class="button" /></td>
      <td align="right" nowrap="true" colspan="8">
      {include file="page.htm"}
      </td>
  </tr>
</table>

{if $full_page}
</div>
<!-- end users list -->
</form>
<script type="text/javascript" language="JavaScript">
<!--
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};

{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}

{literal}
onload = function()
{
    document.forms['searchForm'].elements['shop_name'].focus();
    // 开始检查订单
    startCheckOrder();
}

/**
 * 搜索用户
 */
function searchUser()
{
    listTable.filter['shop_name'] = Utils.trim(document.forms['searchForm'].elements['shop_name'].value);
    listTable.filter['waiter_name'] = Utils.trim(document.forms['searchForm'].elements['waiter_name'].value);
    listTable.filter['rank'] = document.forms['searchForm'].elements['user_rank'].value;
    listTable.filter['pay_points_gt'] = Utils.trim(document.forms['searchForm'].elements['pay_points_gt'].value);
    listTable.filter['pay_points_lt'] = Utils.trim(document.forms['searchForm'].elements['pay_points_lt'].value);
    listTable.filter['page'] = 1;
    listTable.loadList();
}

function confirm_bath()
{
  userItems = document.getElementsByName('checkboxes[]');

  cfm = '{$lang.list_remove_confirm}';

  for (i=0; userItems[i]; i++)
  {
    if (userItems[i].checked && userItems[i].notice == 1)
    {
      cfm = '{$lang.list_still_accounts}' + '{$lang.list_remove_confirm}';
      break;
    }
  }

  return confirm(cfm);
}
//-->
</script>
{/literal}
{include file="pagefooter.htm"}
{/if}